 /***************************************************************** 
 *
 * FILE        : ADC_conf.c
 * 
 * DESCRIPTION : This file includes diferents configurations for the  
 *               ADC module MPC5604B
 *	             
 *               
 * 
 * COPYRIGHT   :(c) 2009, Freescale & STMicroelectronics 
 * 
 * VERSION     : 01.00 
 * DATE        : 26 SEPTEMBER 2012 
 * AUTHOR      : UTCH RAPTOR TEAM
 * HISTORY     : 
 *               
 *
 ******************************************************************/ 
 
 
 #include "MPC5604B_0M27V_0102.h"
 
 /* CONFIGURACION DEL ADC, CON EL REG MCR */
 
 void ADC_configuration(void)
 {
 	
  ADC.MCR.R = 0x20000000;         /* Initialize ADC0 for scan (CONTINUOS READING) mode (ADC.MCR.MODE.B = 1)*/
  ADC.NCMR[0].R=0x000F;     /* Select ANS0-ANS4 inputs for conversion */
  ADC.CTR[0].R = 0x00008606;      /* Conversion times for 32MHz ADClock */
  ADC.MCR.B.NSTART=1; 
 }
 
 
 
 /*PAD CONFIGURATION FOR ADC PRESICION CHANESLS*/
 void Pad_configuration(void)
 {
 	
  SIU.PCR[20].R = 0x2000;         /* MPC56xxB: Initialize PB[4] as ANP0 */
  //SIU.PCR[21].R = 0x2000;         /* MPC56xxB: Initialize PB[5] as ANP1 */
  SIU.PCR[22].R = 0x2000;         /* MPC56xxB: Initialize PB[6] as ANP2 */
  SIU.PCR[23].R = 0x2000;         /* MPC56xxB: Initialize PB[7] as ANP3 */
  SIU.PCR[48].R = 0x2000;         /* MPC56xxB: Initialize PD[0] as ANP4 */
  SIU.PCR[49].R = 0x2000;         /* MPC56xxB: Initialize PD[1] as ANP5 */
  SIU.PCR[50].R = 0x2000;         /* MPC56xxB: Initialize PD[2] as ANP6 */
  //SIU.PCR[51].R = 0x2000;         /* MPC56xxB: Initialize PD[3] as ANP7 */
  //SIU.PCR[52].R = 0x2000;         /* MPC56xxB: Initialize PD[4] as ANP8 */
  //SIU.PCR[53].R = 0x2000;         /* MPC56xxB: Initialize PD[5] as ANP9 */
  //SIU.PCR[54].R = 0x2000;         /* MPC56xxB: Initialize PD[6] as ANP10 */
  //SIU.PCR[55].R = 0x2000;         /* MPC56xxB: Initialize PD[7] as ANP11 */
  //SIU.PCR[56].R = 0x2000;         /* MPC56xxB: Initialize PD[8] as ANP12 */
  //SIU.PCR[57].R = 0x2000;         /* MPC56xxB: Initialize PD[9] as ANP13 */
  //SIU.PCR[58].R = 0x2000;         /* MPC56xxB: Initialize PD[10] as ANP14 */
  //SIU.PCR[59].R = 0x2000;         /* MPC56xxB: Initialize PD[11] as ANP15 */
  
  
   /*PAD CONFIGURATION FOR ADC STANDAR CHANESLS*/
 
  //SIU.PCR[24].R = 0x2000;         /* MPC56xxB: Initialize PB[8] as ANS0 */
  //SIU.PCR[25].R = 0x2000;         /* MPC56xxB: Initialize PB[9] as ANS1 */
  //SIU.PCR[26].R = 0x2000;         /* MPC56xxB: Initialize PB[10] as ANS2 */
  //SIU.PCR[27].R = 0x2000;         /* MPC56xxB: Initialize PB[11] as ANS3 */
  //SIU.PCR[60].R = 0x2000;         /* MPC56xxB: Initialize PD[12] as ANS4 */
  //SIU.PCR[61].R = 0x2000;         /* MPC56xxB: Initialize PD[13] as ANS5 */
  //SIU.PCR[62].R = 0x2000;         /* MPC56xxB: Initialize PD[14] as ANS6 */
  //SIU.PCR[63].R = 0x2000;         /* MPC56xxB: Initialize PD[15] as ANS7 */
  //SIU.PCR[80].R = 0x2000;         /* MPC56xxB: Initialize PF[0] as ANS8 */
  //SIU.PCR[81].R = 0x2000;         /* MPC56xxB: Initialize PF[1] as ANS9 */
  //SIU.PCR[82].R = 0x2000;         /* MPC56xxB: Initialize PF[2] as ANS10 */
  //SIU.PCR[83].R = 0x2000;         /* MPC56xxB: Initialize PF[3] as ANS11 */
  //SIU.PCR[84].R = 0x2000;         /* MPC56xxB: Initialize PF[4] as ANS12 */
  //SIU.PCR[85].R = 0x2000;         /* MPC56xxB: Initialize PF[5] as ANS13 */
  //SIU.PCR[86].R = 0x2000;         /* MPC56xxB: Initialize PF[6] as ANS14 */
  //SIU.PCR[87].R = 0x2000;         /* MPC56xxB: Initialize PF[7] as ANS15 */
  
 }
